<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tag</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="RhythmCat Music Player Development Reference Manual">
<link rel="up" href="ch01.html" title="Player Backend">
<link rel="prev" href="RhythmCat-Core.html" title="Core">
<link rel="next" href="RhythmCat-CUE-Parser.html" title="CUE Parser">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="RhythmCat-Core.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">RhythmCat Music Player Development Reference Manual</th>
<td><a accesskey="n" href="RhythmCat-CUE-Parser.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#RhythmCat-Tag.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#RhythmCat-Tag.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Tag">
<a name="RhythmCat-Tag"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="RhythmCat-Tag.top_of_page"></a>Tag</span></h2>
<p>Tag — Process the tags of the music.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="RhythmCat-Tag.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;tag.h&gt;

                    <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData">RCMusicMetaData</a>;
<a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="returnvalue">RCMusicMetaData</span></a> *   <a class="link" href="RhythmCat-Tag.html#rc-tag-read-metadata" title="rc_tag_read_metadata ()">rc_tag_read_metadata</a>                (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *uri</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="RhythmCat-Tag.html#rc-tag-free" title="rc_tag_free ()">rc_tag_free</a>                         (<em class="parameter"><code><a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="RhythmCat-Tag.html#rc-tag-set-playing-metadata" title="rc_tag_set_playing_metadata ()">rc_tag_set_playing_metadata</a>         (<em class="parameter"><code>const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);
const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="returnvalue">RCMusicMetaData</span></a> * <a class="link" href="RhythmCat-Tag.html#rc-tag-get-playing-metadata" title="rc_tag_get_playing_metadata ()">rc_tag_get_playing_metadata</a>     ();
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="RhythmCat-Tag.html#rc-tag-get-name-from-fpath" title="rc_tag_get_name_from_fpath ()">rc_tag_get_name_from_fpath</a>          (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="RhythmCat-Tag.html#rc-tag-find-file" title="rc_tag_find_file ()">rc_tag_find_file</a>                    (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>,
                                                         <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>,
                                                         <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *extname</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="RhythmCat-Tag.html#rc-tag-search-lyric-file" title="rc_tag_search_lyric_file ()">rc_tag_search_lyric_file</a>            (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="RhythmCat-Tag.html#rc-tag-search-album-file" title="rc_tag_search_album_file ()">rc_tag_search_album_file</a>            (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="RhythmCat-Tag.description"></a><h2>Description</h2>
<p>
Process the tags of the music, like metadata, etc.
</p>
</div>
<div class="refsect1" title="Details">
<a name="RhythmCat-Tag.details"></a><h2>Details</h2>
<div class="refsect2" title="RCMusicMetaData">
<a name="RCMusicMetaData"></a><h3>RCMusicMetaData</h3>
<pre class="programlisting">typedef struct {
    gint64 length;
    gchar *uri;
    guint tracknum;
    guint bitrate;
    gint samplerate;
    gint channels;
    gchar *title;
    gchar *artist;
    gchar *album;
    gchar *comment;
    gchar *file_type;
    gchar *emb_cue;
    GstBuffer *image;
    gboolean eos;
    gboolean audio_flag;
    gboolean video_flag;
    gpointer user_data;
} RCMusicMetaData;
</pre>
<p>
Custom struct type to store the music metadata.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> <em class="structfield"><code><a name="RCMusicMetaData.length"></a>length</code></em>;</span></p></td>
<td>the length of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.uri"></a>uri</code></em>;</span></p></td>
<td>the URI of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="RCMusicMetaData.tracknum"></a>tracknum</code></em>;</span></p></td>
<td>the track number of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="RCMusicMetaData.bitrate"></a>bitrate</code></em>;</span></p></td>
<td>the bitrate of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="RCMusicMetaData.samplerate"></a>samplerate</code></em>;</span></p></td>
<td>the sample rate of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="RCMusicMetaData.channels"></a>channels</code></em>;</span></p></td>
<td>the channel number of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.title"></a>title</code></em>;</span></p></td>
<td>the title text of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.artist"></a>artist</code></em>;</span></p></td>
<td>the artist text of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.album"></a>album</code></em>;</span></p></td>
<td>the album text of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.comment"></a>comment</code></em>;</span></p></td>
<td>the comment text of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.file-type"></a>file_type</code></em>;</span></p></td>
<td>the file type of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.emb-cue"></a>emb_cue</code></em>;</span></p></td>
<td>the embeded CUE data of the music
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *<em class="structfield"><code><a name="RCMusicMetaData.image"></a>image</code></em>;</span></p></td>
<td>the GstBuffer which contains the cover image
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="RCMusicMetaData.eos"></a>eos</code></em>;</span></p></td>
<td>the EOS signal
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="RCMusicMetaData.audio-flag"></a>audio_flag</code></em>;</span></p></td>
<td>whether this file has audio
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="RCMusicMetaData.video-flag"></a>video_flag</code></em>;</span></p></td>
<td>whether this file has video
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="RCMusicMetaData.user-data"></a>user_data</code></em>;</span></p></td>
<td>the user data
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_read_metadata ()">
<a name="rc-tag-read-metadata"></a><h3>rc_tag_read_metadata ()</h3>
<pre class="programlisting"><a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="returnvalue">RCMusicMetaData</span></a> *   rc_tag_read_metadata                (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *uri</code></em>);</pre>
<p>
Read tag (metadata) from given URI.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>the URI of the music file
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The Metadata of the music, NULL if the file is not a music file,
free after usage.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_free ()">
<a name="rc-tag-free"></a><h3>rc_tag_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                rc_tag_free                         (<em class="parameter"><code><a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);</pre>
<p>
Free the memory allocated for metadata struct (RCMusicMetaData).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>mmd</code></em> :</span></p></td>
<td>the metadata
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_set_playing_metadata ()">
<a name="rc-tag-set-playing-metadata"></a><h3>rc_tag_set_playing_metadata ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                rc_tag_set_playing_metadata         (<em class="parameter"><code>const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);</pre>
<p>
Set playing metadata.
Please do not use this function in plugins.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>mmd</code></em> :</span></p></td>
<td>the metadata
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_get_playing_metadata ()">
<a name="rc-tag-get-playing-metadata"></a><h3>rc_tag_get_playing_metadata ()</h3>
<pre class="programlisting">const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="returnvalue">RCMusicMetaData</span></a> * rc_tag_get_playing_metadata     ();</pre>
<p>
Return the metadata which the player is playing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The metadata which the player is playing.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_get_name_from_fpath ()">
<a name="rc-tag-get-name-from-fpath"></a><h3>rc_tag_get_name_from_fpath ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             rc_tag_get_name_from_fpath          (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre>
<p>
Return the base-name without extension from a full path or file name.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the full path or file name
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The base-name without extension.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_find_file ()">
<a name="rc-tag-find-file"></a><h3>rc_tag_find_file ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             rc_tag_find_file                    (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>,
                                                         <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *str</code></em>,
                                                         <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *extname</code></em>);</pre>
<p>
Find a file in the directory by extension name and prefix string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dirname</code></em> :</span></p></td>
<td>the directory name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>the prefix string of the file name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extname</code></em> :</span></p></td>
<td>the extenstion name of the file
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The file name which is found in the directory, NULL if not found,
free after usage.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_search_lyric_file ()">
<a name="rc-tag-search-lyric-file"></a><h3>rc_tag_search_lyric_file ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             rc_tag_search_lyric_file            (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);</pre>
<p>
Search lyric file in given directory by the given metadata.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dirname</code></em> :</span></p></td>
<td>the directory name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mmd</code></em> :</span></p></td>
<td>the metadata
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The file name which is found in the directory, NULL if not found,
free after usage.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="rc_tag_search_album_file ()">
<a name="rc-tag-search-album-file"></a><h3>rc_tag_search_album_file ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             rc_tag_search_album_file            (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="RhythmCat-Tag.html#RCMusicMetaData" title="RCMusicMetaData"><span class="type">RCMusicMetaData</span></a> *mmd</code></em>);</pre>
<p>
Search album image file in given directory by the given metadata.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dirname</code></em> :</span></p></td>
<td>the directory name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mmd</code></em> :</span></p></td>
<td>the metadata
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The file name which is found in the directory, NULL if not found,
free after usage.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>